import type { FormItemDto } from '../types'
import { Component, Prop, Emit, Watch } from 'vue-facing-decorator'
import Render from '@/render/Render'
import toNative from '@/utils/toNative'

@Component
export class TextComponent extends Render {
    @Prop() formData!: FormItemDto
    @Prop() modelValue?: string

    render() {
        return (
            <div style="line-height: 20px" class={this.formData?.params?.class ?? ''}>
                {this.formData?.params?.prefix}
                {this.formData?.value ?? this.formData?.defaultValue}
                {this.formData?.params?.suffix}
            </div>
        )
    }
}

export default toNative<{}, { click: (data: any) => void }>(TextComponent)
